//引入必要模块
const express = require('express');
const body_parser = require('body-parser');
const userRouter = require('./router/user');
const ajaxRouter = require('./router/ajax');
const proRouter = require('./router/pro');

//创建服务器
const app = express();
app.listen(8080);

//调用静态页面
app.use(express.static('./public'));

//解析数据
app.use(body_parser.urlencoded({
    extended:false,
}));

//挂载路由器
app.use('/user',userRouter);
app.use('/ajax',ajaxRouter);
app.use('/pro',proRouter);